from passlib.context import CryptContext

pwd_context = CryptContext(schemes=["bcrypt"], deprecated="auto")

def verify_password(plain_password: str, hashed_password: str) -> bool:
    """
    验证密码
    :param plain_password:原密码
    :param hashed_password:hash后密码
    :return:
    """
    return pwd_context.verify(plain_password, hashed_password)
    
def get_password_hash(password: str) -> str:
    """
    获取hash后的密码
    :param password:原密码
    :return:
    """
    return pwd_context.hash(password)